<template>
  <div>
    {{ listData.lenght }}

    <van-cell-group>
      <van-cell
        v-for="(item, index) in listData"
        :key="index"
        @click="
          $router.push({
            path: '/showmoreVideo',
            query: {
              cid: item.cid,
            },
          })
        "
      >
        <template slot="title">
          <img
            class="search-icon"
            src="../../../assets/images/audio-play.png"
            alt=""
          />
          <span>{{ item.title }}</span>
        </template>
      </van-cell>
    </van-cell-group>
  </div>
</template>

<script>
import { getSearchResultApi } from '@/api'
export default {
  props: ['value'],
  data() {
    return {
      /*    queryData: {
        keyword: this.value,
        page: 1,
        size: 3,
      }, */
      listData: null,
      cid: null,
    }
  },
  created() {},
  async mounted() {},
  methods: {
    async getlist1(val) {
      try {
        const { data: res } = await getSearchResultApi({
          keyword: val,
          page: 1,
          size: 3,
        })
        // console.log(res.data.video.length)
        this.listData = res.data.video
        console.log(this.listData)

        // 更改条数
        // this.$emit('countAll', this.listData.length)
      } catch (err) {
        console.log(err)
      }
    },
  },
}
</script>
<style lang="scss" scoped>
.search-icon {
  width: 16px;
  height: 16px;
  margin-right: 5px;
}
</style>
